
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(signal LANGUAGES C)

include_directories(../common)

set(COMPILE_ALL OFF)

list(APPEND _sources
    ../common/error.c
    ../common/prexit.c
    ../common/lockfile.c
    ../common/setfd.c
    ../common/setfl.c
    ../common/clrfl.c
    ../common/lockreg.c
    ../common/locktest.c
    ../common/tellwait.c
)

if (COMPILE_ALL)
add_executable(pipe1 01_pipe1.c ${_sources})
add_executable(pipe2 02_pipe2.c ${_sources})
add_executable(popen2 04_popen2.c ${_sources})
add_executable(myuclc 06_myuclc.c ${_sources})
add_executable(popen1 07_popen1.c ${_sources})
add_executable(add2 08_add2.c ${_sources})
add_executable(pipe4 09_pipe4.c ${_sources})
add_executable(add2stdio 10_add2stdio.c ${_sources})
add_executable(tshm 11_tshm.c ${_sources})

else()
add_executable(devzero 12_devzero.c ${_sources})
endif()
